#!/bin/bash

ver=$1

ant

cd dist
mv *gz _archive
mv *zip _archive
mv *dmg _archive
dir=PexifTool_$ver
mkdir $dir
mv PexifTool.jar $dir/

# windows version
cp PexifTool.bat $dir/
zip -r PexifTool_$ver.zip $dir
rm $dir/PexifTool.bat

# linux version
cp PexifTool.sh $dir/
tar cf PexifTool_$ver.tar $dir
rm $dir/PexifTool.sh
gzip PexifTool_$ver.tar

# mac os
cp -f $dir/PexifTool.jar PexifTool.app/Contents/Resources/Java
hdiutil create PexifTool_$ver.dmg -volname "PexifTool" -fs HFS+ -srcfolder PexifTool.app

rm -r $dir
